package com.ruoyi.webs.utils;


import java.util.regex.Pattern;

public class RegisterUtils
{
    public static final String ACCOUNT_EXP = "1";
    public static final String CREDIT_EXP = "2";
    public static final String IDCARD_EXP = "3";
    public static final String PASSPORT_EXP = "4";
    public static final String TW_EXP = "5";
    public static final String HK_EXP = "6";
    public static final String PHONE_EXP = "7";
    public static final String NAME_EXP = "8";
    public static final String TEL_EXP = "9";
    public static final String PHONE_OR_TEL__EXP = "10";
    public static final String ZIP_CODE_EXP = "11";
    public static final String EMAIL = "12";

    public static Boolean test(String type, String value) {
        String str;
        switch ((str = type).hashCode()) { case 49: if (!str.equals("1"))
            break;
            return Boolean.valueOf(Pattern.compile("[a-zA-Z][0-9a-zA-Z_]{3,29}").matcher(value).matches());
            case 50:
                if (!str.equals("2"))
                    break;  value = value.split("-")[0];
                return Boolean.valueOf(Pattern.compile("[1-9A-GY]{1}[1239]{1}[1-9]{1}[0-9]{5}[0-9A-Z]{10}").matcher(value).matches());
            case 51: if (!str.equals("3"))
                break;  return Boolean.valueOf(Pattern.compile("(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)").matcher(value).matches());
            case 52: if (!str.equals("4"))
                break;  return Boolean.valueOf(Pattern.compile("^[a-zA-Z0-9]{5,17}$").matcher(value).matches());
            case 53: if (!str.equals("5"))
                break;  return Boolean.valueOf(Pattern.compile("^\\d{8}|^[a-zA-Z0-9]{10}|^\\d{18}$").matcher(value).matches());
            case 54: if (!str.equals("6"))
                break;  return Boolean.valueOf(Pattern.compile("^[HMhm]{1}([0-9]{10}|[0-9]{8})$").matcher(value).matches());
            case 55: if (!str.equals("7"))
                break;  return Boolean.valueOf(Pattern.compile("^[1](([3|5|8][\\d])|([4][4,5,6,7,8,9])|([6][2,5,6,7])|([7][^9])|([9][1,8,9]))[\\d]{8}$").matcher(value).matches());
            case 56: if (!str.equals("8"))
                break;  return Boolean.valueOf(Pattern.compile("^[一-龥豈-鶴·s]{2,20}$").matcher(value).matches());
            case 57: if (!str.equals("9"))
                break;  return Boolean.valueOf(Pattern.compile("^(\\d{3,4}-)?\\d{6,8}$").matcher(value).matches());
            case 1567: if (!str.equals("10"))
                break;  return Boolean.valueOf(Pattern.compile("^(\\d{3,4}-)?\\d{6,8}$|(^[1](([3|5|8][\\d])|([4][4,5,6,7,8,9])|([6][2,5,6,7])|([7][^9])|([9][1,8,9]))[\\d]{8}$)").matcher(value).matches());
            case 1568: if (!str.equals("11"))
                break;  return Boolean.valueOf(Pattern.compile("^[0-9]\\d{5}$").matcher(value).matches());
            case 1569: if (!str.equals("12"))
                break;  return Boolean.valueOf(Pattern.compile("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$").matcher(value).matches()); }

        return Boolean.valueOf(true);
    }
}
